'use strict';

var React = require('react-native');
var {AppRegistry, Navigator, StyleSheet,Text,View} = React;

var {Router, Route, Schema, Animations, TabBar} = require('react-native-router-flux');

var TabView = require('./TabView');

class TabIcon extends React.Component {
    render(){
        return (
            <Text style={{color: this.props.selected ? 'red' :'black'}}>{this.props.title}</Text>
        );
    }
}

class layout extends React.Component {
    render() {
        return (
            <Router hideNavBar={true} >
                
                <Schema name="tab" type="switch" icon={TabIcon} />

               
                <Route name="tabbar">
                    <Router footer={TabBar} showNavigationBar={false}>
                        <Route name="tab1" schema="tab" title="壹点灵" hideNavBar={true} >
                            <Router>
                                <Route name="tab1_1" component={TabView} title="Tab #1_1" />
                                <Route name="tab1_2" component={TabView} title="Tab #1_2" />
                            </Router>
                        </Route>
                        <Route name="tab2" schema="tab" title="心事" hideTabBar={true} component={TabView} />
                        <Route name="tab3" schema="tab" title="消息" component={TabView} />
                        <Route name="tab4" schema="tab" title="我的" component={TabView} />
                    </Router>
                </Route>
            </Router>
        );
    }
}
module.exports=layout;